package com.hightrast.service.api.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 佣金发放状态
 *
 */
public enum PaybackStatusEnum implements IEnum<Integer> {

    Issuing(1, "Issuing"), // 发放中

    Not_issued(2, "Not issued"), //不发放

    Issued(3, "Issued") //已发放
    ;

    /**
     * 值
     */
    @EnumValue
    private final Integer value;

    /**
     * 描述
     */
    private final String desc;


    PaybackStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @JsonCreator
    public static PaybackStatusEnum getItem(int code) {
        for (PaybackStatusEnum item : values()) {
            if (item.getValue() == code) {
                return item;
            }
        }
        return null;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @JsonValue
    public String getDesc() {
        return desc;
    }
}
